package com.link2room.cms.entity;

import com.link2room.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author sqj88
 * @date 2017/12/1 16:59
 */
@Entity
@Table(name = "article_detail")
@DynamicInsert
public class ArticleDetail extends BaseEntity{
    private String articleId;
    private String language;
    private String title;
    private String url;
    private String template;
    private String descript;
    private String articleBody;
    private Long clickCount;
    private String isAudit;
    private String ptitle;
    private String litPic;
    private String pics;

    @Basic
    @Column(name = "article_id", nullable = false, length = 64)
    public String getArticleId() {
        return articleId;
    }

    public void setArticleId(String articleId) {
        this.articleId = articleId;
    }

    @Basic
    @Column(name = "language", nullable = true, length = 32)
    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    @Basic
    @Column(name = "title", nullable = true, length = 32)
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "url", nullable = true, length = 32)
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Basic
    @Column(name = "template", nullable = true, length = -1)
    public String getTemplate() {
        return template;
    }

    public void setTemplate(String template) {
        this.template = template;
    }

    @Basic
    @Column(name = "descript", nullable = true)
    public String getDescript() {
        return descript;
    }

    public void setDescript(String descript) {
        this.descript = descript;
    }

    @Basic
    @Column(name = "article_body", nullable = true)
    public String getArticleBody() {
        return articleBody;
    }

    public void setArticleBody(String articleBody) {
        this.articleBody = articleBody;
    }

    @Basic
    @Column(name = "ptitle", nullable = true)
    public String getPtitle() {
        return ptitle;
    }

    public void setPtitle(String ptitle) {
        this.ptitle = ptitle;
    }

    @Basic
    @Column(name = "lit_pic", nullable = true)
    public String getLitPic() {
        return litPic;
    }

    public void setLitPic(String litPic) {
        this.litPic = litPic;
    }

    @Basic
    @Column(name = "pics", nullable = true)
    public String getPics() {
        return pics;
    }

    public void setPics(String pics) {
        this.pics = pics;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ArticleDetail that = (ArticleDetail) o;

        if (articleId != null ? !articleId.equals(that.articleId) : that.articleId != null) return false;
        if (language != null ? !language.equals(that.language) : that.language != null) return false;
        if (title != null ? !title.equals(that.title) : that.title != null) return false;
        if (url != null ? !url.equals(that.url) : that.url != null) return false;
        if (template != null ? !template.equals(that.template) : that.template != null) return false;
        if (descript != null ? !descript.equals(that.descript) : that.descript != null) return false;
        if (articleBody != null ? !articleBody.equals(that.articleBody) : that.articleBody != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = articleId != null ? articleId.hashCode() : 0;
        result = 31 * result + (language != null ? language.hashCode() : 0);
        result = 31 * result + (title != null ? title.hashCode() : 0);
        result = 31 * result + (url != null ? url.hashCode() : 0);
        result = 31 * result + (template != null ? template.hashCode() : 0);
        result = 31 * result + (descript != null ? descript.hashCode() : 0);
        result = 31 * result + (articleBody != null ? articleBody.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "click_count", nullable = true)
    public Long getClickCount() {
        return clickCount;
    }

    public void setClickCount(Long clickCount) {
        this.clickCount = clickCount;
    }

    @Basic
    @Column(name = "is_audit", length = 2)
    public String getIsAudit() {
        return isAudit;
    }

    public void setIsAudit(String isAudit) {
        this.isAudit = isAudit;
    }




    public enum ArticleDetail_{
        language,articleId
    }
}
